package com.zbest.zpay.acctrans.share.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zbest.zpay.acctrans.common.exception.AccTransRuntimeException;
import com.zbest.zpay.acctrans.dal.mapper.TxcdInfMapper;
import com.zbest.zpay.acctrans.dal.model.TxcdInf;
import com.zbest.zpay.acctrans.enums.biz.AcctransBizCode;
import com.zbest.zpay.acctrans.share.TxcdInfService;

/**
 * Created by wenfeihu on 16/5/25.
 */
@Service("txcdInfService")
public class TxcdInfServiceImpl implements TxcdInfService {

    @Autowired
    private TxcdInfMapper txcdInfMapper;

    @Override
    public void isExist(String txCd) {
        TxcdInf txcdInf = txcdInfMapper.qryTxcdInf(txCd);
        if (txcdInf == null) {
            throw new AccTransRuntimeException(AcctransBizCode.ACT_TXCD_NOT_DEF,
                    "交易码未定义");
        }
    }
}
